/* Top Bar */
// a.k.a. the panel

#panel {
  background-color: $panel;
  font-weight: bold;
  height: $item_size;
  color: $panel-text-secondary;
  font-feature-settings: "tnum";
  transition-duration: 250ms;
  @include fontsize($font_size - 1);

  @if $translucent == 'false' {
    @if $topbar == 'dark' {
      box-shadow: 0 3px 8px rgba(black, 0.2);
    } @else {
      box-shadow: 0 3px 8px rgba(black, 0.1);
    }
  } @else {
    box-shadow: none !important;
  }

  // the rounded outset corners
  .panel-corner {
    -panel-corner-radius: 0;
    -panel-corner-background-color: $panel;
    -panel-corner-border-width: 2px;
    -panel-corner-border-color: transparent;
    -panel-corner-opacity: 1;
    transition-duration: 250ms;
  }

  // panel menus
  .panel-button {
    -natural-hpadding: $base_padding * 2;
    -minimum-hpadding: $base_padding;
    font-weight: bold;
    color: $panel-text-secondary;
    transition-duration: 150ms;
    border-radius: 0;
    text-shadow: none;
    border: none;
    border-bottom: 2px solid transparent !important;

    &.clock-display {
      .clock {
        transition-duration: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: none;
      }

      &:hover {
        color: $panel-text;
        background-color: overlay($panel, focus) !important;
        box-shadow: none !important;
      }

      &:active, &:overview, &:focus, &:checked {
        color: $panel-text;
        background-color: overlay($panel, checked) !important;
        box-shadow: none !important;
        border-color: $indicator !important;
      }
    }

    &:hover {
      color: $panel-text;
      background-color: overlay($panel, focus);
      box-shadow: none;
    }

    &:active, &:overview, &:focus, &:checked {
      color: $panel-text;
      background-color: overlay($panel, checked);
      box-shadow: none;
      border-color: $indicator !important;
    }

    .unlock-screen &,
    .login-screen &,
    .lock-screen & {
      color: $panel-text;
      &:focus, &:hover, &:active { color: $panel-text; }
    }

    // status area icons
    .system-status-icon {
      icon-size: $base_icon_size;
      padding: $base_padding;
      margin: 0;
      spacing: $base_spacing
    }

    // .panel-status-indicators-box .system-status-icon,
    // .panel-status-menu-box .system-status-icon { margin: 0; }

    .appindicator-trayicons-box { margin: 0 $base_padding; }

    .panel-status-indicators-box,
    .panel-status-menu-box {
      spacing: $base_spacing / 2;
    }

    // spacing between power icon and (optional) percentage label
    .power-status.panel-status-indicators-box {
      spacing: ($base_spacing / 2) - 1px;
    }

    // app menu icon
    .app-menu-icon {
      -st-icon-style: symbolic;
      // dimensions of the icon are hardcoded
    }

    &#panelActivities {
      -natural-hpadding: $base_padding * 3;

      StBoxLayout {
        spacing: $base_padding;
      }

      .workspace-dot {
        border-radius: $circular_radius;
        min-width: 8px;
        min-height: 8px;
        background-color: $panel-text;
      }
    }
  }

  // Input indicators
  Gjs_status_keyboard_InputSourceIndicator.panel-button, // Ibus
  Gjs_appindicatorsupport_rgcjonas_gmail_com_indicatorStatusIcon_AppIndicatorsIndicatorStatusIcon.panel-button { // Fcitx
    -natural-hpadding: $base_padding * 3 !important;
    -minimum-hpadding: $base_padding * 3 !important;
  }

  // transparent panel on lock & login screens
  &:overview,
  &.unlock-screen,
  &.login-screen,
  &.lock-screen {
    background-color: transparent;
    box-shadow: none;

    StLabel, StIcon { color: on(dark, secondary); }

    .panel-button {
      border-radius: $button_radius;
      border: none !important;

      &:hover {
        color: on(dark);
        background-color: overlay(dark, hover);
        box-shadow: none;
      }

      &:active, &:overview, &:focus, &:checked {
        color: on(dark);
        background-color: overlay(dark, active);
        box-shadow: none;
      }

      &.clock-display {
        box-shadow: none;

        .clock {
          box-shadow: none;
        }

        &:hover {
          background-color: overlay(dark, hover) !important;
          box-shadow: none !important;
        }
  
        &:active, &:overview, &:focus, &:checked {
          background-color: overlay(dark, active) !important;
          box-shadow: none !important;
        }
      }

      &#panelActivities {
        .workspace-dot {
          background-color: on(dark);
        }
      }
    }

    .panel-corner {
      -panel-corner-radius: 0;
      -panel-corner-background-color: transparent;
      -panel-corner-border-color: transparent;
    }
  }

  // indicator for active
  .screencast-indicator,
  .remote-access-indicator { color: $warning; }
}
